package com.ee.chat.admin.controller;

import com.ee.chat.admin.service.IIndexService;
import com.ee.chat.common.entity.AdminUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
public class IndexController {
    private Logger log = LoggerFactory.getLogger(IndexController.class);

    @Resource
    IIndexService indexService;

    @RequestMapping("/")
    public String index(HttpServletRequest request){
        HttpSession session = request.getSession(true);
        AdminUser adminUser = (AdminUser) session.getAttribute("adminUser");
        if(adminUser != null){
            return "redirect:/toDashboard";
        }else{
            return "index";
        }
    }

    @RequestMapping("toDashboard")
    public String dashboard(HttpServletRequest request, Model model){
        HttpSession session = request.getSession(true);
        model.addAttribute("menuTrees", indexService.getUserMenuTrees(session));
        model.addAttribute("adminUser", session.getAttribute("adminUser"));
        return "dashboard";
    }

    @RequestMapping("toHome")
    public String toHome(){
        return "home/home";
    }

    @RequestMapping("toUpdPwd")
    public String toUpdPwd(){
        return "updPwd";
    }

    @RequestMapping("toRoleManage")
    public String toRoleManage(){
        return "systemmanage/role/list";
    }

    @RequestMapping("toEditRole")
    public String roEditRole(){
        return "systemmanage/role/edit";
    }

    @RequestMapping("toAdminUserManage")
    public String toAdminUserManager(){
        return "systemmanage/adminUser/list";
    }

    @RequestMapping("toEditAdminUser")
    public String toEditAdminUser(){
        return "systemmanage/adminUser/edit";
    }

    @RequestMapping("toOperationManage")
    public String toOperationManage(){
        return "systemmanage/operation/list";
    }

    @RequestMapping("toSysConfigManage")
    public String toSysConfigManage(){
        return "systemmanage/sysConfig/list";
    }

    @RequestMapping("toUserManage")
    public String toUserManage(){
        return "usermanage/user/list";
    }

    @RequestMapping("toEditUser")
    public String toEditUser(){
        return "usermanage/user/edit";
    }

    @RequestMapping("toUpdateStatusManage")
    public String toUpdateStatusManage(){
        return "usermanage/user/updateStatus";
    }

    @RequestMapping("toDisableImeiManage")
    public String toDisableImeiManage(){
        return "usermanage/user/disableImei";
    }

    @RequestMapping("toEditInvite")
    public String toEditInvite(){
        return "usermanage/user/editInvite";
    }

    @RequestMapping("toRecharge")
    public String toRecharge(){
        return "usermanage/user/recharge";
    }

    @RequestMapping("toUserInfoManage")
    public String toUserInfoManage(){
        return "usermanage/user/info";
    }

    @RequestMapping("toHostManage")
    public String toHostManage(){
        return "usermanage/host/list";
    }

    @RequestMapping("toUpdateLevel")
    public String toUpdateLevel(){
        return "usermanage/host/updateLevel";
    }

    @RequestMapping("toUpdateTitle")
    public String toUpdateTitle(){
        return "usermanage/host/updateTitle";
    }

    @RequestMapping("toEditImLimitManage")
    public String toEditImLimitManage(){
        return "usermanage/user/imLimit";
    }

    @RequestMapping("toVipManage")
    public String toVipManage(){
        return "usermanage/vip/list";
    }

    @RequestMapping("toVipAdd")
    public String toVipAdd(){
        return "usermanage/vip/edit";
    }

    @RequestMapping("toInviteManage")
    public String toInviteManage(){
        return "usermanage/invite/list";
    }

    @RequestMapping("toAuthManage")
    public String toAuthManage(){
        return "auditmanage/auth/list";
    }

    @RequestMapping("toWithdrawManage")
    public String toWithdrawManage(){
        return "auditmanage/withdraw/list";
    }

    @RequestMapping("toDynamicManage")
    public String toDynamicManage(){
        return "auditmanage/dynamic/list";
    }

    @RequestMapping("toCreditExchangeManage")
    public String toCreditExchangeManage(){
        return "auditmanage/crditExchange/list";
    }

    @RequestMapping("toRegisterManage")
    public String toRegisterManage(){
        return "dataauditmanage/register/list";
    }

    @RequestMapping("toIconManage")
    public String toIconManage(){
        return "dataauditmanage/icon/list";
    }

    @RequestMapping("toNameManage")
    public String toNameManage(){
        return "dataauditmanage/name/list";
    }

    @RequestMapping("toPersionSignManage")
    public String toPersionSignManage(){
        return "dataauditmanage/persionSign/list";
    }

    @RequestMapping("toPotosManage")
    public String toPotosManage(){
        return "dataauditmanage/potos/list";
    }

    @RequestMapping("toPersionVideoManage")
    public String toPersionVideoManage(){
        return "dataauditmanage/persionVideo/list";
    }

    @RequestMapping("toRefuseAudit")
    public String toRefuseAudit(){
        return "common/audit/refuse";
    }

    @RequestMapping("toRechargeManage")
    public String toRechargeManage(){
        return "walletmanage/recharge/list";
    }

    @RequestMapping("toCoinManage")
    public String toCoinManage(){
        return "walletmanage/coin/list";
    }

    @RequestMapping("toCreditManage")
    public String toCreditManage(){
        return "walletmanage/credit/list";
    }

    @RequestMapping("toCoinStatisticManage")
    public String toCoinStatisticManage(){
        return "walletmanage/coinStatistic/list";
    }

    @RequestMapping("toCreditStatisticManage")
    public String toCreditStatisticManage(){
        return "walletmanage/creditStatistic/list";
    }

    @RequestMapping("toIMManage")
    public String toIMManage(){
        return "im/index";
    }

    @RequestMapping("toImDetailManage")
    public String toImDetailManage(){
        return "operatemanage/im/list";
    }

    @RequestMapping("toViewUserImLog")
    public String toViewUserImLog(){
        return "operatemanage/im/view";
    }

    @RequestMapping("toCallManage")
    public String toCallManage(){
        return "operatemanage/call/list";
    }

    @RequestMapping("toRemarkManage")
    public String toRemarkManage(){
        return "operatemanage/remark/list";
    }

    @RequestMapping("toEditRemark")
    public String toEditRemark(){
        return "operatemanage/remark/edit";
    }

    @RequestMapping("toComplaintManage")
    public String toComplaintManage(){
        return "operatemanage/complaint/list";
    }

    @RequestMapping("toSensitiveWordManage")
    public String toSensitiveWordManage(){
        return "operatemanage/sensitiveWord/list";
    }

    @RequestMapping("toAddSensitiveWord")
    public String toAddSensitiveWord(){
        return "operatemanage/sensitiveWord/add";
    }

    @RequestMapping("toKeyWordManage")
    public String toKeyWordManage(){
        return "operatemanage/keyWord/list";
    }

    @RequestMapping("toAddKeyWord")
    public String toAddKeyWord(){
        return "operatemanage/keyWord/add";
    }

    @RequestMapping("toChannelManage")
    public String toChannelManage(){
        return "channelmanage/channel/list";
    }

    @RequestMapping("toEditChannel")
    public String toEditChannel(){
        return "channelmanage/channel/edit";
    }

    @RequestMapping("toChannelConfigManage")
    public String toChannelConfigManage(){
        return "channelmanage/config/list";
    }

    @RequestMapping("toEditChannelConfig")
    public String toEditChannelConfig(){
        return "channelmanage/config/edit";
    }

    @RequestMapping("toGiftManage")
    public String toGiftManage(){
        return "materialmanage/gift/list";
    }

    @RequestMapping("toEditGift")
    public String toEditGift(){
        return "materialmanage/gift/edit";
    }

    @RequestMapping("toBannerManage")
    public String toBannerManage(){
        return "materialmanage/banner/list";
    }

    @RequestMapping("toEditBanner")
    public String toEditBanner(){
        return "materialmanage/banner/edit";
    }

    @RequestMapping("toVersionManage")
    public String toVersionManage(){
        return "materialmanage/version/list";
    }

    @RequestMapping("toEditVersion")
    public String toEditVersion(){
        return "materialmanage/version/edit";
    }

    @RequestMapping("toPushMessageManage")
    public String toPushMessageManage(){
        return "materialmanage/push/list";
    }

    @RequestMapping("toPushMessageAdd")
    public String toPushMessageAdd(){
        return "materialmanage/push/edit";
    }

    @RequestMapping("toCallContentManage")
    public String toCallContentManage(){
        return "auditmanage/callContent/list";
    }

    /*
    @RequestMapping("toChannelStatisManage")
    public String toChannelStatisManage(){
        return "channelmanage/statis/list";
    }

    @RequestMapping("toUserInfoAuditManage")
    public String toUserInfoAuditManage(){
        return "auditmanage/userInfo/list";
    }

    @RequestMapping("toKillUserImLog")
    public String toKillUserImLog(){
        return "datastatis/im/kill";
    }

    @RequestMapping("toInviteRechargeStatisManage")
    public String toInviteRechargeStatisManage(){
        return "datastatis/inviteRecharge/list";
    }

    @RequestMapping("toHoldAppraiseManage")
    public String toHoldAppraiseManage(){
        return "operatemanage/holdAppraise/list";
    }

    @RequestMapping("toDataAnalysisManage")
    public String toDataAnalysisManage(){
        return "operatemanage/dataAnalysis/list";
    }

    @RequestMapping("toImAnalysisManage")
    public String toImAnalysisManage(){
        return "datastatis/imAnalysis/list";
    }
*/
    @RequestMapping("toSetCleanManage")
    public String toSetCleanManage(){
        return "usermanage/user/clean";
    }

    @RequestMapping("toSubmitCleanWithdraw")
    public String toSubmitCleanWithdraw(){
        return "usermanage/user/submitCleanWithdraw";
    }
}
